package com.example.configserverha;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.core.env.Environment;

@SpringBootApplication
@EnableConfigServer
@EnableEurekaClient
public class ConfigServerHaApplication implements CommandLineRunner{
	private static Log logger = LogFactory.getLog(ConfigServerHaApplication.class);
	public static void main(String[] args) {
		SpringApplication.run(ConfigServerHaApplication.class, args);
	}

	/*	@Value("${info.bar}")*/
	private String password="test";
	@Autowired
	private Environment environment;

	@Override
	public void run(String... args) throws Exception {
		//logger.info("And info.bar: " + this.environment.getProperty("info.bar"));
		//logger.info("And info.spam: " + this.environment.getProperty("spring.datasource.password"));
	}
}
